package com.ruoyi.admin.controller;

import com.ruoyi.app.domain.ArticleInfo;
import com.ruoyi.app.domain.TravelRoute;
import com.ruoyi.admin.service.TravelRouteService;
import com.ruoyi.app.domain.VideoInfo;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/*
@description:旅行路线
@ClassName TravelRouteController
@author chen
@create 2025-04-06 2:16
@Version 1.0
*/
@Slf4j
@RestController
@RequestMapping("route")
@AllArgsConstructor
public class TravelRouteController extends BaseController
{

    final TravelRouteService travelRouteService;

    /*
     * @==============History===============<br/>
     * @Description //   上传旅行推荐
     * @Date 2025-3-13 23:30
     * @Author < a href="15991488967@163.com">chen</ a>
     * @return com.ruoyi.framework.web.domain.AjaxResult
     */
    @PostMapping(value = "/insertTravelRouteInfo",produces = "application/json;charset=utf-8")
    public AjaxResult insertTravelRouteInfo(@RequestBody TravelRoute travelRoute)
    {
        return travelRouteService.insertTravelRouteInfo(travelRoute);
    }


    @PostMapping(value = "/updateTravelRouteInfo",produces = "application/json;charset=utf-8")
    public AjaxResult updateTravelRouteInfo(@RequestBody TravelRoute travelRoute)
    {
        return travelRouteService.updateTravelRouteInfo(travelRoute);
    }



    /*
     * @==============History===============<br/>
     * @Description //   获取旅行路线列表
     * @Date 2025-4-6 9:22
     * @Author < a href="15991488967@163.com">chen</ a>
     * @return com.ruoyi.framework.web.domain.AjaxResult
     */
    @GetMapping(value = "/getTravelRouteList",produces = "application/json;charset=utf-8")
    public TableDataInfo getTravelRouteList(@RequestParam Map<String,Object> params)
    {
        startPage();
        List<TravelRoute> list = travelRouteService.getTravelRouteList(params);
        return getDataTable(list);
    }


    @GetMapping(value = "/getTravelRouteById",produces = "application/json;charset=utf-8")
    public AjaxResult getTravelRouteById(@RequestParam("id") Long id)
    {
        return travelRouteService.getTravelRouteById(id);
    }

    @DeleteMapping(value = "/deleteRouteById",produces = "application/json;charset=utf-8")
    public AjaxResult deleteRouteById(@RequestParam("id") Long id)
    {
        return travelRouteService.deleteRouteById(id);
    }


}
